<template>
	<view class="u-p-30">
		<view class="u-font-46">
			登录之后，体验更多功能
		</view>
		<view class="u-font-30 u-m-tb-30" style="color: rgba(153, 153, 153, 1);">
			结识更多朋友
		</view>

		<view class="flex-center u-m-tb-200">

			<image src="../../static/logo.jpg" class="logo" mode=""></image>
		</view>

		<view class="flex-center" @click="toindex">
			<button class="wxlogin">微信登录</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code: ''
			};
		},
		onLoad() {
			
		},
		methods: {
			getcode() {
				var that = this
				uni.login({
					success(res) {
						that.$api.post('/Account/authLogin', {
							code: res.code
						}).then(res => {
							uni.setStorageSync('token',res.data.token)
							uni.switchTab({
								url: '/pages/index/index'
							})
						})
					},

					fail(res) {

					}

				});
			},
			async toindex() {
				await this.getcode()
				
			},
		}
	}
</script>

<style lang="scss">
	.logo {
		width: 187rpx;
		height: 187rpx;
		border-radius: 50%;
	}

	.wxlogin {
		background-color: rgba(73, 192, 100, 1);
		width: 686rpx;
		color: #fff;
	}
</style>